#define _CRT_SECURE_NO_WARNINGS
#include<string.h>
#include<stdio.h>
/*void reverse(char* left, char* right)
{
	while (left < right)
	{
		char tmp = *left;
		*left = *right;
		*right = tmp;
		left++;
		right--;
	}
}
int main()
{
	char arr[101] = { 0 };
	//gets(arr);
	//scanf("%[^\n]s", arr);
	char ch = 0;
	int i = 0;
	while ((ch = getchar()) != '\n')
	{
		arr[i] = ch;
		i++;
	}
	size_t len = strlen(arr);
	reverse(arr, arr + len - 1);
	char* cur = arr;
	while (*cur)
	{
		char* start = cur;
		while (*cur != ' ' && *cur!='\0')
		{
			cur++;
		}
		char* end = cur - 1;
		reverse(start, end);
		if (*cur == ' ')
			cur++;
	}
	printf("%s", arr);
	return 0;
}*/
int main()
{
	char word[100] = { 0 };
	gets(word);
	int sz = strlen(word) - 1;
	while (sz)
	{
		if (word[sz] == ' ')
		{
			printf("%s ", &word[sz + 1]);
			word[sz] = '\0';
		}
		if (sz == 0)
		{
			break;
		}
		sz--;
	}
	printf("%s", &word[sz]);
	return 0;
}